<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Music
 * @copyright  Copyright 2006-2010 Webligo Developments
 * @license    http://www.socialengine.com/license/
 * @version    $Id: view.tpl 9747 2012-07-26 02:08:08Z john $
 * @author     Steve
 */

// this is done to make these links more uniform with other viewscripts
$playlist = $this->recorder;
?>

<?php
    $this->headScript()
      ->appendFile($this->layout()->staticBaseUrl . 'application/modules/Recorder/externals/scripts/swfobject.js');
     $this->headScript()
       ->appendFile($this->layout()->staticBaseUrl . 'externals/soundmanager/script/soundmanager2'
           . (APPLICATION_ENV == 'production' ? '-nodebug-jsmin' : '' ) . '.js')
    ->appendFile($this->layout()->staticBaseUrl . 'application/modules/Music/externals/scripts/core.js')
    ->appendFile($this->layout()->staticBaseUrl . 'application/modules/Music/externals/scripts/player.js')
 

?>

<?php if ($this->popout): ?>
<?php $this->headTitle($playlist->getTitle(), Zend_View_Helper_Placeholder_Container_Abstract::SET) ?>
  <div class="music_playlist_popout_wrapper">
    <div class="music_playlist_info_title">
      <h3><?php echo $playlist->getTitle() ?></h3>
    </div>
    <div class="music_playlist_info_date">
          <?php echo $this->translate('Created %1$s by %2$s', $this->timestamp($playlist->creation_date), $this->htmlLink($playlist->getOwner(), $playlist->getOwner()->getTitle())) ?>
    </div>
    <?php echo $this->partial('_Player.tpl', array('recorders'=>array($playlist),'popout'=>true)) ?>
  </div>
<?php return; endif; ?>

<h2>
  <?php echo $playlist->getTitle() ?>
</h2>

<div class="music_playlist" id="music_playlist_item_<?php echo $playlist->getIdentity() ?>">
  <div class="music_browse_author_photo">
    <?php echo $this->htmlLink($playlist->getOwner(), $this->itemPhoto($playlist->getOwner(), 'thumb.icon') ) ?>
  </div>



  <div class="music_playlist_info">
    <div class="music_playlist_info_title">
      <p><?php echo $playlist->description ?></p>
    </div>
    <div class="music_playlist_info_date">
          <?php echo $this->translate('Created %s by ', $this->timestamp($playlist->creation_date)) ?>
          <?php echo $this->htmlLink($playlist->getOwner(), $playlist->getOwner()->getTitle()) ?>
    </div>

    <?php echo $this->partial('_Player.tpl', array('recorders'=>array($playlist))) ?>
  </div>
  
  <div class='video_options'>
  <?php if($this->can_delete):?>
    <?php echo $this->htmlLink(array(
        'route' => 'default',
        'module' => 'recorder',
        'controller' => 'index',
        'action' => 'delete',
        'recorder_id' => $this->recorder->recorder_id,
        'format' => 'smoothbox'
      ), $this->translate('Delete'), array(
        'class' => 'smoothbox'
        //'class' => 'buttonlink smoothbox icon_video_delete'
      )) ?>
      &nbsp;|&nbsp;
   <?php endif;?>
    <?php if( Engine_Api::_()->user()->getViewer()->getIdentity() ): ?>
      <?php echo $this->htmlLink(array(
        'module'=> 'activity',
        'controller' => 'index',
        'action' => 'share',
        'route' => 'default',
        'type' => 'recorder',
        'id' => $this->recorder->getIdentity(),
        'format' => 'smoothbox'
      ), $this->translate("Share"), array(
        'class' => 'smoothbox'
        //'class' => 'buttonlink smoothbox icon_comments'
      )); ?>
      &nbsp;|&nbsp;
      <?php echo $this->htmlLink(array(
        'module'=> 'core',
        'controller' => 'report',
        'action' => 'create',
        'route' => 'default',
        'subject' => $this->recorder->getGuid(),
        'format' => 'smoothbox'
      ), $this->translate("Report"), array(
        'class' => 'smoothbox'
        //'class' => 'buttonlink smoothbox icon_report'
      )); ?>
      &nbsp;|&nbsp;
    <?php endif ?>
    <?php echo $this->translate(array('%s view', '%s views', $this->recorder->view_count), $this->locale()->toNumber($this->recorder->view_count)) ?>
  </div>
</div>



